package com.ycrlkj.android.modulescore.main.module;

import com.ycrlkj.android.modulescore.main.apiservice.AddressApiService;
import com.ycrlkj.android.modulescore.main.apiservice.DictValueApiService;
import com.ycrlkj.android.modulescore.main.apiservice.FreightOrderApiService;
import com.ycrlkj.android.modulescore.main.apiservice.GoodsTypeApiService;
import com.ycrlkj.android.modulescore.main.apiservice.NoauthApiService;
import com.ycrlkj.android.modulescore.main.apiservice.OrderStateApiService;
import com.ycrlkj.android.modulescore.main.apiservice.PayApiService;
import com.ycrlkj.android.modulescore.main.apiservice.UserApiService;
import com.ycrlkj.android.modulescore.main.apiservice.VehicleApiService;
import com.ycrlkj.android.modulescore.main.apiservice.XxAppointmentApiService;
import com.ycrlkj.android.modulescore.main.apiservice.XxOrderApiService;
import com.ycrlkj.android.modulescore.main.apiservice.XxStationApiService;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import dagger.hilt.InstallIn;
import dagger.hilt.android.components.ApplicationComponent;
import retrofit2.Retrofit;

@InstallIn(ApplicationComponent.class) //装载到ApplicationComponent中
@Module //配置 @Provides 注解实现注入
public class ApiServiceModule {

    @Singleton
    @Provides
    VehicleApiService vehicleApiService(Retrofit retrofit) {
        return retrofit.create(VehicleApiService.class);
    }

    @Singleton
    @Provides
    FreightOrderApiService freightOrderApiService(Retrofit retrofit) {
        return retrofit.create(FreightOrderApiService.class);
    }

    @Singleton
    @Provides
    XxOrderApiService xxOrderApiService(Retrofit retrofit) {
        return retrofit.create(XxOrderApiService.class);
    }

    @Singleton
    @Provides
    XxStationApiService xxStationApiService(Retrofit retrofit) {
        return retrofit.create(XxStationApiService.class);
    }

    @Singleton
    @Provides
    XxAppointmentApiService xxAppointmentApiService(Retrofit retrofit) {
        return retrofit.create(XxAppointmentApiService.class);
    }

    @Singleton
    @Provides
    UserApiService userApiService(Retrofit retrofit) {
        return retrofit.create(UserApiService.class);
    }

    @Singleton
    @Provides
    PayApiService payApiService(Retrofit retrofit) {
        return retrofit.create(PayApiService.class);
    }

    @Singleton
    @Provides
    OrderStateApiService orderStateApiService(Retrofit retrofit) {
        return retrofit.create(OrderStateApiService.class);
    }

    @Singleton
    @Provides
    DictValueApiService dictValueApiService(Retrofit retrofit) {
        return retrofit.create(DictValueApiService.class);
    }

    @Singleton
    @Provides
    NoauthApiService noauthApiService(Retrofit retrofit) {
        return retrofit.create(NoauthApiService.class);
    }

    @Singleton
    @Provides
    GoodsTypeApiService goodsTypeApiService(Retrofit retrofit) {
        return retrofit.create(GoodsTypeApiService.class);
    }

    @Singleton
    @Provides
    AddressApiService addressApiService(Retrofit retrofit) {
        return retrofit.create(AddressApiService.class);
    }

}
